<ui:composition layout="block" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
      
		<h:form prependId="false">
		  <h:panelGroup layout="block" styleClass="corpo_esquerda">
		  <p:imageSwitch effect="zoom">
		  	<h:graphicImage style="margin: 5px 0 0 12px" library="image" name="img_dica_saude.png" />
		  	<h:graphicImage style="margin: 5px 0 0 12px" library="image" name="img_dica_alimentacao.png" />
		  </p:imageSwitch>		  	
		  </h:panelGroup>
	      <h:panelGroup layout="block" styleClass="corpo_direita">
	      
	      	<h:panelGroup layout="block" style="height:56px">
	      		<h:outputText value="Área restrita" style="color:#FFF;margin:22px 0 0 20px;float:left;font-size:18px" />
	      	</h:panelGroup>      	
	      	
	      	<h:panelGroup layout="block" style="height:56px;height:163px">
	      		<h:panelGrid columns="2" style="margin:30px 0 0 28px" id="pnl_login" cellspacing="2" cellpadding="0" rendered="#{empty usuarioLogadoBean.form.usuario}">
	      			<h:outputLabel value="Usuário" for="usuario" styleClass="fmt_texto_login" />
	      			<h:inputText id="usuario" value="#{autenticaUsuarioBean.form.usuario.login}" styleClass="fmt_campo_login" required="true" requiredMessage="Campo obrigatório" label="usuario" />
	      			
	      			<h:outputText />
	      			<h:message for="usuario" id="msgUsuario" style="font-size:10px;color:red" />
	      			
	      			<h:outputLabel value="Senha" for="senha" styleClass="fmt_texto_login" />
	      			<h:inputSecret id="senha" value="#{autenticaUsuarioBean.form.usuario.senha}" styleClass="fmt_campo_login" maxlength="8" required="true" requiredMessage="Campo obrigatório" label="usuario" />
	      			
	      			<h:outputText />
	      			<h:message for="senha" id="msgSenha" style="font-size:10px;color:red" />
	      			
	      			<h:outputText />
	      			<p:commandLink ajax="false" style="margin-left:80px" action="#{autenticaUsuarioBean.autenticarUsuario}">
	      				<h:graphicImage library="image" name="bt_entrar.png" style="border:none" />
	      			</p:commandLink>
	      			
	      		</h:panelGrid>
	      		
				<h:panelGroup style="margin-top:16px;float:left" layout="block" rendered="#{empty usuarioLogadoBean.form.usuario}">
					<h:link style="margin-left:20px;font-size:10px" outcome="/paginas/cadastrar">Cadastre-se</h:link>
	      			<p:commandLink onclick="reenviarSenha.show();" style="margin-left:20px;font-size:10px" action="#{autenticaUsuarioBean.limpaCampo}" process="@this" update="reenviarSenha,msgReenviarEmail">Esqueci minha senha</p:commandLink>
				</h:panelGroup>
		      		
	      		<h:panelGroup layout="block" style="margin:35px 0 0 35px" rendered="#{!empty usuarioLogadoBean.form.usuario}">
	      			
	      			<h:outputText value="Nome: " styleClass="fmt_label_info_usuario" />
	      			<h:outputText value="#{usuarioLogadoBean.form.usuario.nome}" styleClass="fmt_field_info_usuario" />
	      			<br />
	      			<h:outputText value="E-mail: " styleClass="fmt_label_info_usuario" />
	      			<h:outputText value="#{usuarioLogadoBean.form.usuario.email}" styleClass="fmt_field_info_usuario" />
	      			<br />
	      			<h:outputText value="Perfil: " styleClass="fmt_label_info_usuario" />
	      			<h:outputText value="#{usuarioLogadoBean.form.usuario.perfil.tipoPerfil}" styleClass="fmt_field_info_usuario" />
	      			<br />
	      			<h:outputText value="Nome de usuário: " styleClass="fmt_label_info_usuario" />
	      			<h:outputText value="#{usuarioLogadoBean.form.usuario.login}" styleClass="fmt_field_info_usuario" />
	      			<br />
	      			<h:outputText value="Quantidade de acessos: " styleClass="fmt_label_info_usuario" />
	      			<h:outputText value="#{usuarioLogadoBean.form.usuario.num_acessos}" styleClass="fmt_field_info_usuario" />	      		
	      		</h:panelGroup>
	      	</h:panelGroup>
	      	
	      </h:panelGroup>
	      
	      <h:panelGroup layout="block" styleClass="container_menu_esquerda">
	      	<h:panelGroup layout="block" styleClass="img_menu_esquerda">
	      		<h:panelGroup layout="block" style="margin:48px 0 0 58px;float:left">
	      			<h:outputText value="#{msg['display.home.menu.cabecalho']}" style="color:#FFF;font-weight:bold" />
	      		</h:panelGroup>
	      		
	      		<h:panelGroup layout="block" style="margin-top:21px;float:left">
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.angiologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.cardiologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.cirurgia.geral']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.clinica.geral']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.ginicologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.neurologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.oftamologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.pedagogia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
		      		<h:panelGroup layout="block" styleClass="link_menu_esquerda">
		      			<h:link value="#{msg['display.home.menu.especialidades.urologia']}" styleClass="formatacao_menu_esquerda" />
		      		</h:panelGroup>
	      		</h:panelGroup>	      		
	      		
	      	</h:panelGroup>
	      	<h:panelGroup layout="block" style="width:204px;height:145px;margin:auto;margin-top:10px">
	      		<h:commandLink>
	      			<h:graphicImage library="image" name="img_como_chegar.png" style="border:none" />
	      		</h:commandLink>      		
	      	</h:panelGroup> 
	      </h:panelGroup>
	      
	      <h:panelGroup layout="block" style="width:753px;height:521px;float:left;">
	      	<h:panelGroup layout="block" styleClass="img_container_pricipal">
	      	
	      		<h:panelGroup layout="block" style="width:741px;height:350px;margin-top:135px">
	      		
	      			<h:panelGroup layout="block" styleClass="img_caixa_info">
	      				<h:panelGroup layout="block" style="height:38px">
	      					<h:outputText value="#{msg['display.home.titulo.caixa.noticias']}" styleClass="fmt_titulo_caixa" />
	      				</h:panelGroup>
	      				
	      				<h:panelGroup layout="block" style="height:279px;width:208px">
	      					<h:panelGroup layout="block" style="height:130px;width:208px;">
	      						<h:graphicImage library="image" name="img_noticia.png" style="margin:12px 0 0 12px" />
	      					</h:panelGroup>
	      					<p class="fmt_conteudo_caixa">#{msg['display.home.noticia']}</p>
	      					<h:outputLink style="float:right;margin-top:18px;margin-right:7px;font-size:10px">#{msg['display.home.caixa.info']}</h:outputLink>
	      				</h:panelGroup>	      				
	      				
	      			</h:panelGroup>
	      			
	      			<h:panelGroup layout="block" styleClass="img_caixa_info">
	      				<h:panelGroup layout="block" style="height:38px">
	      					<h:outputText value="#{msg['display.home.titulo.caixa.exames']}" styleClass="fmt_titulo_caixa" />
	      				</h:panelGroup>
	      				
	      				<h:panelGroup layout="block" style="height:279px;width:208px">
	      					<h:panelGroup layout="block" style="height:130px;width:208px;">
	      						<h:graphicImage library="image" name="img_exame.png" style="margin:12px 0 0 12px" />
	      					</h:panelGroup>
	      					
	      					<p class="fmt_conteudo_caixa">#{msg['display.home.exames']}</p>
	      					<h:outputLink style="float:right;margin-top:30px;margin-right:7px;font-size:10px">#{msg['display.home.caixa.info']}</h:outputLink>		
	      				</h:panelGroup>
	      			</h:panelGroup>
	      			
	      			<h:panelGroup layout="block" styleClass="img_caixa_info">
	      				<h:panelGroup layout="block" style="height:38px">
	      					<h:outputText value="#{msg['display.home.titulo.caixa.especialistas']}" styleClass="fmt_titulo_caixa" />
	      				</h:panelGroup>
	      				
	      				<h:panelGroup layout="block" style="height:279px;width:208px">
	      					<h:panelGroup layout="block" style="height:130px;width:208px;">
	      						<h:graphicImage library="image" name="img_especialista.png" style="margin:12px 0 0 12px" />
	      					</h:panelGroup>
	      					
	      					<p class="fmt_conteudo_caixa">#{msg['display.home.especialistas']}</p>
	      					<h:outputLink style="float:right;margin-top:30px;margin-right:7px;font-size:10px">#{msg['display.home.caixa.info']}</h:outputLink>
	      				</h:panelGroup>
	      			</h:panelGroup>
	      		
	      		</h:panelGroup>
	      	
	      	</h:panelGroup>	
	      </h:panelGroup>
		</h:form>
		
		<p:dialog header="Esqueci minha senha" widgetVar="reenviarSenha" resizable="false" modal="true" width="300" showEffect="clip" hideEffect="fold">
		
			<h:form prependId="false">
			
				<h:panelGrid columns="1">
					
					<h:outputText value="Digite o email cadastrado:" />
					<p:inputText label="Email" value="#{autenticaUsuarioBean.form.email}" size="40" id="reenviarSenha" required="true" />
					<h:message id="msgReenviarEmail" for="reenviarSenha" style="font-size:10px;color:red" layout="table" />
					<h:panelGroup>
						<p:commandButton value="Enviar Senha" action="#{autenticaUsuarioBean.reenviarEmail}" update="msgReenviarEmail,func_javascript,modal_resposta,reenviarSenha" oncomplete="validaReenviaSenha();" />
						<p:commandButton value="Sair" onclick="reenviarSenha.hide();" />
					</h:panelGroup>

					
				</h:panelGrid>
			
			</h:form>
		
		</p:dialog>
		
		<p:outputPanel id="func_javascript">
			<script type="text/javascript">
	
				function validaReenviaSenha(){
					if(#{!empty requestScope.sucesso}){
						resposta_email.show();
					}
				}
												
								
			</script>
		</p:outputPanel>
		
		<p:dialog header="Aviso" widgetVar="resposta_email" resizable="false" modal="true" width="320" showEffect="clip" hideEffect="fold">
			<h:form prependId="false">
				<h:panelGroup layout="block" style="text-align:center" id="modal_resposta">
					<h:outputText value="Email enviado para #{autenticaUsuarioBean.form.email} com sucesso!" styleClass="sucesso_consulta" />
					<br /><br />
					<p:commandButton value="OK" style="font-weight:bold;font-size:14px" onclick="reenviarSenha.hide();resposta_email.hide();" />
				</h:panelGroup>
				
			</h:form>
		</p:dialog>
		
		
		     
</ui:composition>